package com.smile.utils;

import android.content.Context;

import java.util.List;

/**
 * Created by Administrator on 2015/6/26.
 */
public class SizeUtils {

    public static int Dp2Px(Context context, float dp) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dp * scale + 0.5f);
    }

    public static <V> int getSize(List<V> sourceList) {
        return sourceList == null ? 0 : sourceList.size();
    }
}
